home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / prodpack.zip / DB4PPSRC.EXE / _ERRHELP.PRG < prev    next >
Text File  |  1993-05-04  |  3KB  |  102 lines

  1. *' $Header:   E:/test/sysproc/doc/_errhelp.prv   1.1   05 Apr 1993  8:42:12   Bill Ramos  $
  2. PROCEDURE _ErrHelp
  3. PARAMETERS pc_msg, pl_help, pc_file, pc_name, pc_dbf, pl_keep
  4. *----------------------------------------------------------------------------
  5. * NAME
  6. *   _ErrHelp - Display an error box
  7. *
  8. * SYNOPSIS
  9. *   DO _ErrHelp WITH  pc_msg ,pl_help, pc_file, pc_name, pc_dbf, pl_keep
  10. *
  11. * DESCRIPTION
  12. *   _ErrHelp will display the <pc_msg> string in a box and prompt the
  13. *   user to press any key to continue processing.  _ErrHelp will display
  14. *   the message based on the length of <pc_msg>.
  15. *
  16. * PARAMETERS
  17. *   pc_msg  = Error message to display in the box, up to two lines
  18. *             of 55 characters per line.  Use semi-colon to split
  19. *             the line.  If pc_msg is longer than 55 characters and
  20. *             it does not contain a semi-colon, _ErrHelp will split
  21. *             the line at the last word fits within 55 characters.
  22. *
  23. *   pl_help = Flag that indicates that a help button is needed.
  24. *
  25. *   pc_file = Name of form file in the case of form help, and
  26. *             the of the popup in the case of system help
  27. *
  28. *   pc_name = Name of the field in the case of form help, and
  29. *             the number of the bar in the case of system help
  30. *
  31. *   pc_dbf  = Name of the database to be used by _HelpSys (MFFUHELP,
  32. *             Sys_Help, or an inputted name by the user)
  33. *
  34. *   pl_keep = Keep help database open even if it wasn't open upon entry
  35. *
  36. * EXAMPLE
  37. *   DO _ErrHelp WITH "Incorrect window size"
  38. *   Displays the message in a window as follows:
  39. *
  40. *               +-[o]--------------------------+
  41. *               |                              |
  42. *               | +--------------------------+ |
  43. *               | |   Incorrect window size  | |
  44. *               | |                          | |
  45. *               | +--------------------------+ |
  46. *               |      +----------------+      |
  47. *               |      |    Ok   Help   |      |
  48. *               |      +----------------+      |
  49. *               |                              |
  50. *               +------------------------------+
  51. *
  52. *----------------------------------------------------------------------------
  53.   DECLARE ERRHELP[ 2 ]
  54.     *-- BT_OK -    Ok
  55.     ERRHELP[ 1 ]     = .T.
  56.  
  57.     *-- BT_ERRHLP -   ~Help
  58.     ERRHELP[ 2 ]     = .F.
  59.  
  60.   FXL_Cancel = .F.
  61.   FXL_NoChng = .F.
  62.  
  63.   nSemiColon = AT( ";", pc_msg )
  64.   IF nSemiColon > 0
  65.     Err_Msg1 = LEFT( pc_msg, nSemiColon - 1 )
  66.     Err_Msg2 = SUBSTR( pc_msg, nSemiColon + 1 )
  67.   ELSE
  68.     IF LEN( pc_msg ) > 55
  69.       cLine1 = LEFT( pc_msg, 55 )
  70.       nLastSpace = RAT( " ", cLine1 )
  71.       IF nLastSpace = 0
  72.         Err_Msg1 = LEFT( pc_msg, 55 )
  73.         Err_Msg2 = SUBSTR( pc_msg, 56 )
  74.       ELSE
  75.         Err_Msg1 = TRIM( LEFT( cLine1, nLastSpace - 1 ) )
  76.         Err_Msg2 = SUBSTR( cLine1, nLastSpace + 1 ) + SUBSTR( pc_msg, 56 )
  77.       ENDIF
  78.     ELSE
  79.       Err_Msg1 = pc_Msg
  80.       Err_Msg2 = ""
  81.     ENDIF
  82.   ENDIF
  83.  
  84.   Err_Msg1 = HelpCTit( TRIM( Err_Msg1 ), 55 )
  85.   IF .NOT. ISBLANK( Err_Msg2 )
  86.     Err_Msg2 = HelpCTit( TRIM( Err_Msg2 ), 55 )
  87.   ENDIF
  88.  
  89.   *----------------------
  90.   *-- Call the Dialog box
  91.   *----------------------
  92.   DO ERRHELP
  93.  
  94. RETURN
  95. *-- EOP: _ErrHelp
  96. *'-------------------------------------------------------------------------
  97. *' $Log:   E:/test/sysproc/doc/_errhelp.prv  $
  98. *'-------------------------------------------------------------------------
  99.  
  100.  
  101.  
  102.